<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>3dchess: S:/dev/3dchess/src/logic/ChessBoard.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">3dchess
   </div>
   <div id="projectbrief">Basic chess application with OpenGL graphics and AI</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Macros</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_3d2e4578fe4cc3b7fa6177047437af5b.html">logic</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">ChessBoard.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;stdarg.h&gt;</code><br/>
<code>#include &lt;array&gt;</code><br/>
<code>#include &lt;cmath&gt;</code><br/>
<code>#include &quot;<a class="el" href="_turn_8h_source.html">Turn.h</a>&quot;</code><br/>
</div>
<p><a href="_chess_board_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_po_f.html">PoF</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_chess_board.html">ChessBoard</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a4bff4a569b74534da3369c156777fcd6"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_chess_board_8h.html#a4bff4a569b74534da3369c156777fcd6">BB_SCAN</a>(bb)&#160;&#160;&#160;static_cast&lt;<a class="el" href="_chess_types_8h.html#a1e35064f4b70226adc63b8fe1af7ddf8">Field</a>&gt;(static_cast&lt;int&gt;(std::log2((double)bb))) /* returns the field of MS1B */</td></tr>
<tr class="separator:a4bff4a569b74534da3369c156777fcd6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9814dad88aea6646215dc730ead0f1fc"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_chess_board_8h.html#a9814dad88aea6646215dc730ead0f1fc">BB_SET</a>(field)&#160;&#160;&#160;static_cast&lt;<a class="el" href="_chess_board_8h.html#aa3185f6de0e2faecf73cae8d94dd484a">BitBoard</a>&gt;(std::pow(2, (int)field))    /* returns the value 2^field */</td></tr>
<tr class="separator:a9814dad88aea6646215dc730ead0f1fc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a897626235b7d170885a4578dc0a6c957"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_chess_board_8h.html#a897626235b7d170885a4578dc0a6c957">BIT_SET</a>(bb, field)&#160;&#160;&#160;(bb |=   (<a class="el" href="_chess_board_8h.html#aa3185f6de0e2faecf73cae8d94dd484a">BitBoard</a>)1 &lt;&lt; (field))</td></tr>
<tr class="separator:a897626235b7d170885a4578dc0a6c957"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a579dee1ad3e564a506ad661bdd3aa263"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_chess_board_8h.html#a579dee1ad3e564a506ad661bdd3aa263">BIT_CLEAR</a>(bb, field)&#160;&#160;&#160;(bb &amp;= ~((<a class="el" href="_chess_board_8h.html#aa3185f6de0e2faecf73cae8d94dd484a">BitBoard</a>)1 &lt;&lt; (field)))</td></tr>
<tr class="separator:a579dee1ad3e564a506ad661bdd3aa263"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5edcbf03a35928929ab4a9d98d686ac4"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_chess_board_8h.html#a5edcbf03a35928929ab4a9d98d686ac4">BIT_TOGGLE</a>(bb, field)&#160;&#160;&#160;(bb ^=   (<a class="el" href="_chess_board_8h.html#aa3185f6de0e2faecf73cae8d94dd484a">BitBoard</a>)1 &lt;&lt; (field))</td></tr>
<tr class="separator:a5edcbf03a35928929ab4a9d98d686ac4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac6090f46fd65b24a0388a80664c6c303"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_chess_board_8h.html#ac6090f46fd65b24a0388a80664c6c303">BIT_ISSET</a>(bb, field)&#160;&#160;&#160;(bb &amp; (  (<a class="el" href="_chess_board_8h.html#aa3185f6de0e2faecf73cae8d94dd484a">BitBoard</a>)1 &lt;&lt; (field)))</td></tr>
<tr class="separator:ac6090f46fd65b24a0388a80664c6c303"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:aa3185f6de0e2faecf73cae8d94dd484a"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_chess_board_8h.html#aa3185f6de0e2faecf73cae8d94dd484a">BitBoard</a> = uint64_t</td></tr>
<tr class="separator:aa3185f6de0e2faecf73cae8d94dd484a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a46700dbc06dcb94954bf9179ee2238e4"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_chess_board_8h.html#a46700dbc06dcb94954bf9179ee2238e4">ChessBoardPtr</a> = std::shared_ptr&lt; <a class="el" href="class_chess_board.html">ChessBoard</a> &gt;</td></tr>
<tr class="separator:a46700dbc06dcb94954bf9179ee2238e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ade0288a8194dacaba44609d96584ad02"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_chess_board_8h.html#ade0288a8194dacaba44609d96584ad02">bitBoardToString</a> (<a class="el" href="_chess_board_8h.html#aa3185f6de0e2faecf73cae8d94dd484a">BitBoard</a> b)</td></tr>
<tr class="separator:ade0288a8194dacaba44609d96584ad02"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9e2e1de9e575f66e9f6d4801d76fa2a4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_chess_board_8h.html#aa3185f6de0e2faecf73cae8d94dd484a">BitBoard</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_chess_board_8h.html#a9e2e1de9e575f66e9f6d4801d76fa2a4">generateBitBoard</a> (<a class="el" href="_chess_types_8h.html#a1e35064f4b70226adc63b8fe1af7ddf8">Field</a> f1,...)</td></tr>
<tr class="separator:a9e2e1de9e575f66e9f6d4801d76fa2a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9f2cd8140bd61eb941f1225909d4095e"><td class="memItemLeft" align="right" valign="top">std::array&lt; <a class="el" href="struct_piece.html">Piece</a>, 64 &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_chess_board_8h.html#a9f2cd8140bd61eb941f1225909d4095e">generateChessBoard</a> (std::vector&lt; <a class="el" href="struct_po_f.html">PoF</a> &gt; pieces)</td></tr>
<tr class="separator:a9f2cd8140bd61eb941f1225909d4095e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="a4bff4a569b74534da3369c156777fcd6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BB_SCAN</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">bb</td><td>)</td>
          <td>&#160;&#160;&#160;static_cast&lt;<a class="el" href="_chess_types_8h.html#a1e35064f4b70226adc63b8fe1af7ddf8">Field</a>&gt;(static_cast&lt;int&gt;(std::log2((double)bb))) /* returns the field of MS1B */</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a9814dad88aea6646215dc730ead0f1fc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BB_SET</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">field</td><td>)</td>
          <td>&#160;&#160;&#160;static_cast&lt;<a class="el" href="_chess_board_8h.html#aa3185f6de0e2faecf73cae8d94dd484a">BitBoard</a>&gt;(std::pow(2, (int)field))    /* returns the value 2^field */</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a579dee1ad3e564a506ad661bdd3aa263"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BIT_CLEAR</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">bb, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">field&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;(bb &amp;= ~((<a class="el" href="_chess_board_8h.html#aa3185f6de0e2faecf73cae8d94dd484a">BitBoard</a>)1 &lt;&lt; (field)))</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="ac6090f46fd65b24a0388a80664c6c303"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BIT_ISSET</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">bb, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">field&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;(bb &amp; (  (<a class="el" href="_chess_board_8h.html#aa3185f6de0e2faecf73cae8d94dd484a">BitBoard</a>)1 &lt;&lt; (field)))</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a897626235b7d170885a4578dc0a6c957"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BIT_SET</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">bb, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">field&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;(bb |=   (<a class="el" href="_chess_board_8h.html#aa3185f6de0e2faecf73cae8d94dd484a">BitBoard</a>)1 &lt;&lt; (field))</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a5edcbf03a35928929ab4a9d98d686ac4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BIT_TOGGLE</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">bb, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">field&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;(bb ^=   (<a class="el" href="_chess_board_8h.html#aa3185f6de0e2faecf73cae8d94dd484a">BitBoard</a>)1 &lt;&lt; (field))</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="aa3185f6de0e2faecf73cae8d94dd484a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">using <a class="el" href="_chess_board_8h.html#aa3185f6de0e2faecf73cae8d94dd484a">BitBoard</a> =  uint64_t</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a46700dbc06dcb94954bf9179ee2238e4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">using <a class="el" href="_chess_board_8h.html#a46700dbc06dcb94954bf9179ee2238e4">ChessBoardPtr</a> =  std::shared_ptr&lt;<a class="el" href="class_chess_board.html">ChessBoard</a>&gt;</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ade0288a8194dacaba44609d96584ad02"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string bitBoardToString </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_chess_board_8h.html#aa3185f6de0e2faecf73cae8d94dd484a">BitBoard</a>&#160;</td>
          <td class="paramname"><em>b</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a9e2e1de9e575f66e9f6d4801d76fa2a4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_chess_board_8h.html#aa3185f6de0e2faecf73cae8d94dd484a">BitBoard</a> generateBitBoard </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_chess_types_8h.html#a1e35064f4b70226adc63b8fe1af7ddf8">Field</a>&#160;</td>
          <td class="paramname"><em>f1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>...</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a9f2cd8140bd61eb941f1225909d4095e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::array&lt;<a class="el" href="struct_piece.html">Piece</a>, 64&gt; generateChessBoard </td>
          <td>(</td>
          <td class="paramtype">std::vector&lt; <a class="el" href="struct_po_f.html">PoF</a> &gt;&#160;</td>
          <td class="paramname"><em>pieces</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Dec 27 2013 16:40:12 for 3dchess by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>
